package com.mutual.assistance.auth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mutual.assistance.auth.model.po.MenuPO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MenuMapper extends BaseMapper<MenuPO> {

    @Select("SELECT	* FROM menu WHERE id IN (SELECT menu_id FROM permission WHERE role_id IN ( SELECT role_id FROM user_role WHERE user_id = #{userId} ))")
    List<MenuPO> selectPermissionByUserId(@Param("userId") String userId);
}
